/**
 * 应用程序路由管理
 * Author: xuejianxin
 * Date:2020-08-12
 */


import xue from './xue3'
import { createRouter, createWebHashHistory } from 'vue-router'

const { vload } = xue

const routes = [
    { path: '/', component: vload('/sys/login.html') }
    , { path: '/main', component: vload("/sys/main.html") }
    , { path: '/demo1', component: vload("/demo/demo1/index.html") },
    , { path: '/demo3', component: vload("/demo/demo3/index.html") },
    /*二级路由演示*/
    {
        path: '/demo2/', component: { template: `<router-view></router-view>` }
        //    ^^^^^^^^注意这里的路径前后都有 /
        , children: [
              { path: ''    , component: xue.vload("/demo/demo2/index.html"), alias: 'index' }
            , { path: 'add' , component: xue.vload("/demo/demo2/add.html")  }
            , { path: 'edit', component: xue.vload("/demo/demo2/edit.html") }
            , { path: 'view', component: xue.vload("/demo/demo2/view.html") }
        ]
    }

];
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})
export default router